package com.example.pre.service.impl;

import java.util.Collection;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.pre.dao.ApprovalFormDao;
import com.example.pre.model.ApprovalForm;
import com.example.pre.service.ApprovalFormService;

/*
 * 审批单service层接口
 */
@Service
public class ApprovalFormServiceImpl implements ApprovalFormService {

	@Autowired
	private ApprovalFormDao approvalFromDao;

	@Override
	public ApprovalForm get(int id) {
		return approvalFromDao.get(id);
	}

	@Override
	public Collection<ApprovalForm> getAll() {
		return approvalFromDao.listByCondition(null);
	}

	@Override
	public boolean update(ApprovalForm m) {
		return approvalFromDao.update(m) == 1;
	}

	@Override
	public boolean delete(int id) {
		return approvalFromDao.delete(id) == 1;
	}

	@Override
	public boolean create(ApprovalForm m) {
		return approvalFromDao.create(m) == 1;
	}

	@Override
	public Collection<ApprovalForm> listByCondition(Map<String, Object> whereColumn) {
		return approvalFromDao.listByCondition(whereColumn);
	}

	@Override
	public int countByCondition(Map<String, Object> whereColumn) {
		return approvalFromDao.countByCondition(whereColumn);
	}

}
